package artaza.clasesdao;

import artaza.persistencia.Finca;
import com.google.appengine.api.datastore.Key;
import org.springframework.stereotype.Repository;


@Repository
public class FincaDAOImpl extends GenericDAOJPAImpl<Finca,Key> implements FincaDAO{

     @Override
    public Finca findByNombref(Class<Finca> typeClass, String criterio) {
        String query = "SELECT FROM Finca f WHERE f.nombre='" + criterio + "'";
        Finca finca =  (Finca) em.createQuery(query).getSingleResult();
        return (Finca) finca;
    }

}
   
